/**
 * 系统的密码： 1983
 * 规则如下： 先得到每位数，然后每位数加5 再对10求余。最后将所有的数字反转，得到一串新数
 * 关键点：使用双指针进行反转
 */
public class EncryptNumber {
    public static void main(String[] args) {
        int[] numbers = {1, 9, 8, 3,7};
        int[] encryNumbers = new int[5];
        for (int i = 0; i < numbers.length; i++) {
            encryNumbers[i] = (numbers[i] + 5) % 10;
        }

//        for (int i = encryNumbers.length-1; i >=0; i--) {
//            System.out.print(encryNumbers[i]);
//        }
        int i = 0;
        int j = encryNumbers.length - 1;
        while (i <= j) {
           int temp = encryNumbers[i];
           encryNumbers[i] = encryNumbers[j];
           encryNumbers[j] = temp;
           i++;
           j--;
        }
         System.out.print("加密后的结果:");
        for (int i1 = 0; i1 < encryNumbers.length; i1++) {
            System.out.print(encryNumbers[i1]);
        }
    }
}
